From 58f3afdd98a8c34b799f975fd5fc064d50c7a4eb Mon Sep 17 00:00:00 2001 From: "kaf24@freefall.cl.cam.ac.uk" Date: Tue, 2 Nov 2004 09:08:37 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.332 (41874e954CLIDA2J3phVFD2RnzVTpA) Clean up public XenLinux header files. Now accessible from userspace as #include Got rid of the linux-xen-sparse symlink as it's no longer needed. --- .rootkeys | 4 +- BitKeeper/etc/ignore | 42 ++------- Makefile | 11 +-- linux-2.4.27-xen-sparse/mkbuildtree | 6 +- linux-2.6.9-xen-sparse/arch/xen/Makefile | 3 +- .../arch/xen/kernel/reboot.c | 2 +- .../drivers/xen/privcmd/privcmd.c | 4 +- .../include/asm-xen/linux-public/privcmd.h | 88 +++++++++++++++++++ .../asm-xen/{ => linux-public}/suspend.h | 0 .../include/asm-xen/proc_cmd.h | 65 -------------- tools/Make.defs | 2 - tools/libxc/Makefile | 12 +-- tools/libxc/xc.h | 10 +-- tools/libxc/xc_linux_restore.c | 2 +- tools/libxc/xc_linux_save.c | 2 +- tools/libxc/xc_private.h | 3 +- tools/misc/Makefile | 1 - tools/python/setup.py | 3 +- tools/python/xen/lowlevel/xu/xu.c | 3 +- tools/xentrace/Makefile | 1 - tools/xfrd/Makefile | 3 - 21 files changed, 124 insertions(+), 143 deletions(-) create mode 100644 linux-2.6.9-xen-sparse/include/asm-xen/linux-public/privcmd.h rename linux-2.6.9-xen-sparse/include/asm-xen/{ => linux-public}/suspend.h (100%) delete mode 100644 linux-2.6.9-xen-sparse/include/asm-xen/proc_cmd.h diff --git a/.rootkeys b/.rootkeys index cc0e349319..09094b10b5 100644 --- a/.rootkeys +++ b/.rootkeys @@ -234,10 +234,10 @@ 40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h 412dfaeazclyNDM0cpnp60Yo4xulpQ linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h 40f5623aGPlsm0u1LTO-NVZ6AGzNRQ linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h +3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.9-xen-sparse/include/asm-xen/linux-public/privcmd.h +3fa8e3f0kBLeE4To2vpdi3cpJbIkbQ linux-2.6.9-xen-sparse/include/asm-xen/linux-public/suspend.h 40f5623cndVUFlkxpf7Lfx7xu8madQ linux-2.6.9-xen-sparse/include/asm-xen/multicall.h -3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.9-xen-sparse/include/asm-xen/proc_cmd.h 4122466356eIBnC9ot44WSVVIFyhQA linux-2.6.9-xen-sparse/include/asm-xen/queues.h -3fa8e3f0kBLeE4To2vpdi3cpJbIkbQ linux-2.6.9-xen-sparse/include/asm-xen/suspend.h 3f689063BoW-HWV3auUJ-OqXfcGArw linux-2.6.9-xen-sparse/include/asm-xen/xen_proc.h 4124d8c4aocX7A-jIbuGraWN84pxGQ linux-2.6.9-xen-sparse/include/linux/bio.h 4124f66fp5QwbDHEfoUIa7pqO5Xhag linux-2.6.9-xen-sparse/include/linux/page-flags.h diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index d8bc1ae2f2..59a047ed9a 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -10,7 +10,7 @@ BitKeeper/*/* PENDING/* TAGS -Twisted-1.3.0 +Twisted-1.3.0/* Twisted-1.3.0.tar.gz docs/*.aux docs/*.dvi @@ -20,49 +20,21 @@ docs/*.ps docs/*.toc docs/figs/xenserver.eps docs/html/* -docs/interface/WARNINGS -docs/interface/images.pl -docs/interface/images.tex -docs/interface/img1.png -docs/interface/index.html -docs/interface/interface.css -docs/interface/interface.html -docs/interface/labels.pl -docs/user/WARNINGS -docs/user/images.pl -docs/user/images.tex -docs/user/img1.png -docs/user/img2.png -docs/user/img3.png -docs/user/index.html -docs/user/internals.pl -docs/user/labels.pl -docs/user/user.css -docs/user/user.html -docs/xend/WARNINGS -docs/xend/images.pl -docs/xend/images.tex -docs/xend/img1.png -docs/xend/index.html -docs/xend/internals.pl -docs/xend/labels.pl -docs/xend/xend.css -docs/xend/xend.html +docs/ps/* +docs/pdf/* extras/mini-os/h/hypervisor-ifs -install install/* linux-*-xen0/* linux-*-xenU/* -linux-xen-sparse -netbsd-*-tools -netbsd-*-xen0 -netbsd-*-xenU +netbsd-*-tools/* +netbsd-*-xen0/* +netbsd-*-xenU/* patches/* pristine-* tools/*/build/lib*/*.py tools/balloon/balloon tools/check/.* -tools/libxc/xen +tools/libxc/xen/* tools/misc/miniterm/miniterm tools/misc/xen_cpuperf tools/web-shutdown.tap diff --git a/Makefile b/Makefile index 3147e518d8..18682e6ea1 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ SOURCEFORGE_MIRROR := http://heanet.dl.sourceforge.net/sourceforge .PHONY: docs delete-symlinks clean # a not partcularly useful but safe default target -all: make-symlinks +all: $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install @@ -192,7 +192,7 @@ netbsd: $(MAKE) mk-netbsd-trees $(MAKE) netbsd-xenU -clean: delete-symlinks +clean: $(MAKE) -C xen clean $(MAKE) -C tools clean $(MAKE) -C docs clean @@ -201,13 +201,6 @@ clean: delete-symlinks mrproper: clean rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.* -make-symlinks: delete-symlinks - ln -sf linux-$(LINUX26_VER)-xen-sparse linux-xen-sparse - -delete-symlinks: - $(RM) linux-xen-sparse - -# handy target to install twisted (use rpm or apt-get in preference) install-twisted: wget http://www.twistedmatrix.com/products/get-current.epy tar -zxf Twisted-*.tar.gz diff --git a/linux-2.4.27-xen-sparse/mkbuildtree b/linux-2.4.27-xen-sparse/mkbuildtree index ff5e789ccf..382d90588b 100755 --- a/linux-2.4.27-xen-sparse/mkbuildtree +++ b/linux-2.4.27-xen-sparse/mkbuildtree @@ -209,10 +209,12 @@ ln -sf ../../${LINUX_26}/include/asm-xen/evtchn.h ln -sf ../../${LINUX_26}/include/asm-xen/gnttab.h ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h ln -sf ../../${LINUX_26}/include/asm-xen/multicall.h -ln -sf ../../${LINUX_26}/include/asm-xen/proc_cmd.h -ln -sf ../../${LINUX_26}/include/asm-xen/suspend.h ln -sf ../../${LINUX_26}/include/asm-xen/xen_proc.h +mkdir -p linux-public && cd linux-public +ln -sf ../../../${LINUX_26}/include/asm-xen/linux-public/privcmd.h +ln -sf ../../../${LINUX_26}/include/asm-xen/linux-public/suspend.h + cd ${AD}/arch/xen/kernel ln -sf ../../i386/kernel/i387.c ln -sf ../../i386/kernel/init_task.c diff --git a/linux-2.6.9-xen-sparse/arch/xen/Makefile b/linux-2.6.9-xen-sparse/arch/xen/Makefile index a0d11b2e22..add0e416b9 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/Makefile +++ b/linux-2.6.9-xen-sparse/arch/xen/Makefile @@ -52,7 +52,8 @@ install: vmlinuz install -m0644 vmlinux $(INSTALL_PATH)/boot/vmlinux-syms-$(XINSTALL_NAME)$(INSTALL_SUFFIX) install -m0664 .config $(INSTALL_PATH)/boot/config-$(XINSTALL_NAME)$(INSTALL_SUFFIX) install -m0664 System.map $(INSTALL_PATH)/boot/System.map-$(XINSTALL_NAME)$(INSTALL_SUFFIX) - + mkdir -p $(INSTALL_PATH)/usr/include/xen/linux + install -m0644 include/asm-xen/linux-public/*.h $(INSTALL_PATH)/usr/include/xen/linux dist: $(MAKE) INSTALL_PATH=../install install diff --git a/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c index 2e81929624..bf6e00bd31 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c @@ -13,7 +13,7 @@ static int errno; #include #include #include -#include +#include #include void machine_restart(char * __unused) diff --git a/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c index 4a3d26d61b..4316d8e2f9 100644 --- a/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c +++ b/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c @@ -1,5 +1,5 @@ /****************************************************************************** - * core.c + * privcmd.c * * Interface to privileged domain-0 commands. * @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/linux-public/privcmd.h b/linux-2.6.9-xen-sparse/include/asm-xen/linux-public/privcmd.h new file mode 100644 index 0000000000..9142c6b35d --- /dev/null +++ b/linux-2.6.9-xen-sparse/include/asm-xen/linux-public/privcmd.h @@ -0,0 +1,88 @@ +/****************************************************************************** + * privcmd.h + * + * Interface to /proc/xen/privcmd. + * + * Copyright (c) 2003-2004, K A Fraser + * + * This file may be distributed separately from the Linux kernel, or + * incorporated into other software packages, subject to the following license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this source file (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __PRIVCMD_H__ +#define __PRIVCMD_H__ + +typedef struct privcmd_hypercall +{ + unsigned long op; + unsigned long arg[5]; +} privcmd_hypercall_t; + +typedef struct privcmd_mmap_entry { + unsigned long va; + unsigned long mfn; + unsigned long npages; +} privcmd_mmap_entry_t; + +typedef struct privcmd_mmap { + int num; + domid_t dom; /* target domain */ + privcmd_mmap_entry_t *entry; +} privcmd_mmap_t; + +typedef struct privcmd_mmapbatch { + int num; /* number of pages to populate */ + domid_t dom; /* target domain */ + unsigned long addr; /* virtual address */ + unsigned long *arr; /* array of mfns - top nibble set on err */ +} privcmd_mmapbatch_t; + +typedef struct privcmd_blkmsg +{ + unsigned long op; + void *buf; + int buf_size; +} privcmd_blkmsg_t; + +/* + * @cmd: IOCTL_PRIVCMD_HYPERCALL + * @arg: &privcmd_hypercall_t + * Return: Value returned from execution of the specified hypercall. + */ +#define IOCTL_PRIVCMD_HYPERCALL \ + _IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t)) + +/* + * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN + * @arg: n/a + * Return: Port associated with domain-controller end of control event channel + * for the initial domain. + */ +#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \ + _IOC(_IOC_NONE, 'P', 1, 0) +#define IOCTL_PRIVCMD_MMAP \ + _IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t)) +#define IOCTL_PRIVCMD_MMAPBATCH \ + _IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t)) +#define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \ + _IOC(_IOC_READ, 'P', 4, sizeof(unsigned long)) + +#endif /* __PRIVCMD_H__ */ diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/suspend.h b/linux-2.6.9-xen-sparse/include/asm-xen/linux-public/suspend.h similarity index 100% rename from linux-2.6.9-xen-sparse/include/asm-xen/suspend.h rename to linux-2.6.9-xen-sparse/include/asm-xen/linux-public/suspend.h diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/proc_cmd.h b/linux-2.6.9-xen-sparse/include/asm-xen/proc_cmd.h deleted file mode 100644 index 4292427c68..0000000000 --- a/linux-2.6.9-xen-sparse/include/asm-xen/proc_cmd.h +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** - * proc_cmd.h - * - * Interface to /proc/cmd and /proc/xen/privcmd. - */ - -#ifndef __PROC_CMD_H__ -#define __PROC_CMD_H__ - -typedef struct privcmd_hypercall -{ - unsigned long op; - unsigned long arg[5]; -} privcmd_hypercall_t; - -typedef struct privcmd_mmap_entry { - unsigned long va; - unsigned long mfn; - unsigned long npages; -} privcmd_mmap_entry_t; - -typedef struct privcmd_mmap { - int num; - domid_t dom; /* target domain */ - privcmd_mmap_entry_t *entry; -} privcmd_mmap_t; - -typedef struct privcmd_mmapbatch { - int num; // number of pages to populate - domid_t dom; // target domain - unsigned long addr; // virtual address - unsigned long *arr; // array of mfns - top nibble set on err -} privcmd_mmapbatch_t; - -typedef struct privcmd_blkmsg -{ - unsigned long op; - void *buf; - int buf_size; -} privcmd_blkmsg_t; - -/* - * @cmd: IOCTL_PRIVCMD_HYPERCALL - * @arg: &privcmd_hypercall_t - * Return: Value returned from execution of the specified hypercall. - */ -#define IOCTL_PRIVCMD_HYPERCALL \ - _IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t)) - -/* - * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN - * @arg: n/a - * Return: Port associated with domain-controller end of control event channel - * for the initial domain. - */ -#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \ - _IOC(_IOC_NONE, 'P', 1, 0) -#define IOCTL_PRIVCMD_MMAP \ - _IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t)) -#define IOCTL_PRIVCMD_MMAPBATCH \ - _IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t)) -#define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \ - _IOC(_IOC_READ, 'P', 4, sizeof(unsigned long)) - -#endif /* __PROC_CMD_H__ */ diff --git a/tools/Make.defs b/tools/Make.defs index 7f40cfef6a..132e4347cc 100644 --- a/tools/Make.defs +++ b/tools/Make.defs @@ -1,6 +1,4 @@ # -*- mode: Makefile; -*- -XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/public -XEN_LINUX_INCLUDE = $(XEN_ROOT)/linux-xen-sparse/include XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc XEN_LIBXC = $(XEN_ROOT)/tools/libxc XEN_LIBXUTIL = $(XEN_ROOT)/tools/libxutil diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 9a623bcc6b..f1ccb3538d 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -8,9 +8,6 @@ CC = gcc XEN_ROOT = ../.. include $(XEN_ROOT)/tools/Make.defs -vpath %h $(XEN_LINUX_INCLUDE) -INCLUDES += -I $(XEN_LINUX_INCLUDE) - vpath %c $(XEN_LIBXUTIL) INCLUDES += -I $(XEN_LIBXUTIL) @@ -32,7 +29,7 @@ CFLAGS += -Wall CFLAGS += -Werror CFLAGS += -O3 CFLAGS += -fno-strict-aliasing -CFLAGS += $(INCLUDES) +CFLAGS += $(INCLUDES) -I. # Get gcc to generate the dependencies for us. CFLAGS += -Wp,-MD,.$(@F).d DEPS = .*.d @@ -51,8 +48,11 @@ check-for-zlib: false; \ fi +LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse) mk-symlinks: - [ -e xen ] || ln -sf $(XEN_HYPERVISOR_IFS) xen + [ -e xen/linux ] || mkdir -p xen/linux + lndir -silent ../$(XEN_ROOT)/xen/include/public xen + lndir -silent ../../$(LINUX_ROOT)/include/asm-xen/linux-public xen/linux install: all mkdir -p $(prefix)/usr/lib @@ -63,7 +63,7 @@ install: all install -m0644 xc.h $(prefix)/usr/include clean: - $(RM) *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen + rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen rpm: all rm -rf staging diff --git a/tools/libxc/xc.h b/tools/libxc/xc.h index ab3ace4ff1..7778b71673 100644 --- a/tools/libxc/xc.h +++ b/tools/libxc/xc.h @@ -18,11 +18,11 @@ typedef signed short s16; typedef signed long s32; typedef signed long long s64; -#include "xen/xen.h" -#include "xen/dom0_ops.h" -#include "xen/event_channel.h" -#include "xen/sched_ctl.h" -#include "xen/io/domain_controller.h" +#include +#include +#include +#include +#include /* Obtain or relinquish a handle on the 'xc' library. */ int xc_interface_open(void); diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index 2b3df66dd5..1db39317de 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -7,7 +7,7 @@ */ #include "xc_private.h" -#include +#include #define MAX_BATCH_SIZE 1024 diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index e9f4259494..9ff85a241b 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -8,7 +8,7 @@ #include #include "xc_private.h" -#include +#include #include #define BATCH_SIZE 1024 /* 1024 pages (4MB) at a time */ diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index 8fd4559886..c05ae491d9 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -16,8 +16,7 @@ #include "xc.h" -#include - +#include #define _PAGE_PRESENT 0x001 #define _PAGE_RW 0x002 diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 0dc13c4b50..760348b0b4 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -5,7 +5,6 @@ include $(XEN_ROOT)/tools/Make.defs CC = gcc CFLAGS = -Wall -O3 -INCLUDES += -I $(XEN_LINUX_INCLUDE) INCLUDES += -I $(XEN_XC) INCLUDES += -I $(XEN_LIBXC) INCLUDES += -I $(XEN_LIBXUTIL) diff --git a/tools/python/setup.py b/tools/python/setup.py index ec7efc0b63..99069d0be4 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -7,8 +7,7 @@ XEN_ROOT = "../.." extra_compile_args = [ "-fno-strict-aliasing", "-Wall", "-Werror" ] -include_dirs = [ XEN_ROOT + "/linux-xen-sparse/include", - XEN_ROOT + "/tools/python/xen/lowlevel/xu", +include_dirs = [ XEN_ROOT + "/tools/python/xen/lowlevel/xu", XEN_ROOT + "/tools/libxc", XEN_ROOT + "/tools/libxutil", ] diff --git a/tools/python/xen/lowlevel/xu/xu.c b/tools/python/xen/lowlevel/xu/xu.c index 5143700538..29213e93ff 100644 --- a/tools/python/xen/lowlevel/xu/xu.c +++ b/tools/python/xen/lowlevel/xu/xu.c @@ -25,8 +25,7 @@ #include #include - -#include +#include #define XENPKG "xen.lowlevel.xu" diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile index 7759b90f86..1b13bd9d8b 100644 --- a/tools/xentrace/Makefile +++ b/tools/xentrace/Makefile @@ -5,7 +5,6 @@ include $(XEN_ROOT)/tools/Make.defs CC = gcc CFLAGS = -Wall -Werror -O3 -CFLAGS += -I $(XEN_LINUX_INCLUDE) CFLAGS += -I $(XEN_XC) CFLAGS += -I $(XEN_LIBXC) CFLAGS += -I $(XEN_LIBXUTIL) diff --git a/tools/xfrd/Makefile b/tools/xfrd/Makefile index 9b8d9bc108..c1478ce690 100644 --- a/tools/xfrd/Makefile +++ b/tools/xfrd/Makefile @@ -9,9 +9,6 @@ include $(XEN_ROOT)/tools/Make.defs XFRD_INSTALL_DIR = /usr/sbin -vpath %h $(XEN_LINUX_INCLUDE) -INCLUDES += -I $(XEN_LINUX_INCLUDE) - vpath %.h $(XEN_LIBXC) INCLUDES += -I $(XEN_LIBXC) -- 2.30.2